#pragma once

#include "Str.h"

class Logger
{
private:
    Str fn;
	Str buff;
    bool _echo,_sc;
    void load(const char *filename, bool echo,bool startClose);
    bool timestamp();
public:
	static const char END = '\n';
    Logger(Str &filename,bool echo,bool startClose);
    Logger(const char *filename,bool echo,bool startClose);
    ~Logger();
    Logger& print(Str &text);
    Logger& print(const char *text);
	Logger& buffer(const char *text);
	Logger& buffer(Str &text);
    Logger& operator()(Str &text);
    Logger& operator()(const char *text);
	Logger& operator<<(const char *text);
	Logger& operator<<(Str &text);
};

extern Logger mainLog;
extern Logger errLog;
